#include "stdafx.h"
#include "MonoVar.h"


//******Tab1VarStruct
void InitDateTime(COleDateTime&	birthday)
{
	SYSTEMTIME DefTime;   // Win32 time information
	DefTime.wYear=1800;
	DefTime.wMonth=1;
	DefTime.wDayOfWeek=0;
	DefTime.wDay=1;
	DefTime.wHour=1;
	DefTime.wMinute=1;
	DefTime.wSecond=1;
	DefTime.wMilliseconds=1;
	birthday=DefTime;
}

void
Tab1VarStruct::Initialize()
{
//	id_SinglePageData=0;
	InitDateTime(birthday);
	name=_T(" ");
	nickname=_T(" ");
	age=0;
	twelve=0;
	constellation=0;
	sex=0;
	blood=0;
	marriage=0;
	school=_T(" ");
	degree=0;
	metier=0;
	position=0;
	//picturePath
}

bool
Tab1VarStruct::operator!=(const Tab1VarStruct& var)
{
	return	name			!= var.name ||
			nickname		!= var.nickname ||
			birthday		!= var.birthday ||
			age				!= var.age ||
			twelve			!= var.twelve ||
			constellation	!= var.constellation ||
			sex				!= var.sex ||
			blood			!= var.blood ||
			marriage		!= var.marriage ||
			school			!= var.school ||
			degree			!= var.degree ||
			metier			!= var.metier ||
			position		!= var.position ||
			picturePath		!= var.picturePath;
//			id_SinglePageData!=var.id_SinglePageData;
}

Tab1VarStruct&
Tab1VarStruct::operator = (const Tab1VarStruct& var)
{
	//if(this!=&var){
		name			= var.name;
		nickname		= var.nickname;
		birthday		= var.birthday;
		age				= var.age;
		twelve			= var.twelve;
		constellation	= var.constellation;
		sex				= var.sex;
		blood			= var.blood;
		marriage		= var.marriage;
		school			= var.school;
		degree			= var.degree;
		metier			= var.metier;
		position		= var.position;
		picturePath		= var.picturePath;
		//id_SinglePageData=var.id_SinglePageData;
	//}

	return *this;
}

Tab1VarStruct::Tab1VarStruct(const Tab1VarStruct& var)
{
	name			= var.name;
	nickname		= var.nickname;
	birthday		= var.birthday;
	age				= var.age;
	twelve			= var.twelve;
	constellation	= var.constellation;
	sex				= var.sex;
	blood			= var.blood;
	marriage		= var.marriage;
	school			= var.school;
	degree			= var.degree;
	metier			= var.metier;
	position		= var.position;
	picturePath		= var.picturePath;
	//id_SinglePageData=var.id_SinglePageData;
}

Tab1VarStruct::Tab1VarStruct()
{
	Initialize();
}

//******Tab2VarStruct
void
Tab2VarStruct::Initialize()
{
	//id_SinglePageData=0;
	mobilePhone		=	_T(" ");
	companyPhone	=	_T(" ");
	homePhone		=	_T(" ");
	QQ1				=	_T(" ");
	QQ2				=	_T(" ");
	MSN1			=	_T(" ");
	MSN2			=	_T(" ");
	Skype1			=	_T(" ");
	Skype2			=	_T(" ");
	Email1			=	_T(" ");
	Email2			=	_T(" ");
	companyAddress	=	_T(" ");
	familyAddress	=	_T(" ");
	post			=	_T(" ");
	homePage		=	_T(" ");
}

bool
Tab2VarStruct::operator!=(const Tab2VarStruct& var)
{
	return	mobilePhone		!=	var.mobilePhone		||
			companyPhone	!=	var.companyPhone	||
			homePhone		!=	var.homePhone		||
			QQ1				!=	var.QQ1				||
			QQ2				!=	var.QQ2				||
			MSN1			!=	var.MSN1			||
			MSN2			!=	var.MSN2			||
			Skype1			!=	var.Skype1			||
			Skype2			!=	var.Skype2			||
			Email1			!=	var.Email1			||
			Email2			!=	var.Email2			||
			companyAddress	!=	var.companyAddress	||
			familyAddress	!=	var.familyAddress	||
			post			!=	var.post			||
			homePage		!=	var.homePage;
			//id_SinglePageData != var.id_SinglePageData;
}

Tab2VarStruct&
Tab2VarStruct::operator = (const Tab2VarStruct& var)
{
	if(this!=&var){
		mobilePhone		=	var.mobilePhone;
		companyPhone	=	var.companyPhone;
		homePhone		=	var.homePhone;
		QQ1				=	var.QQ1;
		QQ2				=	var.QQ2;
		MSN1			=	var.MSN1;
		MSN2			=	var.MSN2;
		Skype1			=	var.Skype1;
		Skype2			=	var.Skype2;
		Email1			=	var.Email1;
		Email2			=	var.Email2;
		companyAddress	=	var.companyAddress;
		familyAddress	=	var.familyAddress;
		post			=	var.post;
		homePage		=	var.homePage;
		//id_SinglePageData=var.id_SinglePageData;
	}

	return *this;
}

Tab2VarStruct::Tab2VarStruct(const Tab2VarStruct& var)
{
	mobilePhone		=	var.mobilePhone;
	companyPhone	=	var.companyPhone;
	homePhone		=	var.homePhone;
	QQ1				=	var.QQ1;
	QQ2				=	var.QQ2;
	MSN1			=	var.MSN1;
	MSN2			=	var.MSN2;
	Skype1			=	var.Skype1;
	Skype2			=	var.Skype2;
	Email1			=	var.Email1;
	Email2			=	var.Email2;
	companyAddress	=	var.companyAddress;
	familyAddress	=	var.familyAddress;
	post			=	var.post;
	homePage		=	var.homePage;
	//id_SinglePageData=var.id_SinglePageData;
}

Tab2VarStruct::Tab2VarStruct()
{
	Initialize();
}

//******Tab3VarStruct
void
Tab3ListVarStruct::Initialize()
{
	id_SinglePageData=0;
	id_Tab3ListVarStruct = 0;
	InitDateTime(meetdate);
	event=_T(" ");
	remark=_T(" ");
	backupnbackup=_T(" ");
}

bool
Tab3ListVarStruct::operator!=(const Tab3ListVarStruct& var)
{
	return	id_Tab3ListVarStruct	!=	var.id_Tab3ListVarStruct	||
			event					!=	var.event					||
			meetdate				!=	var.meetdate				||
			remark					!=	var.remark					||
			backupnbackup			!=	var.backupnbackup			||
			id_SinglePageData		!=	var.id_SinglePageData;
}

Tab3ListVarStruct&
Tab3ListVarStruct::operator = (const Tab3ListVarStruct& var)
{
	if(this!=&var){
		id_SinglePageData		=	var.id_SinglePageData;
		id_Tab3ListVarStruct	=	var.id_Tab3ListVarStruct;
		event					=	var.event;
		meetdate				=	var.meetdate;
		remark					=	var.remark;
		backupnbackup			=	var.backupnbackup;
	}

	return *this;
}

Tab3ListVarStruct::Tab3ListVarStruct(const Tab3ListVarStruct& var)
{
	id_Tab3ListVarStruct	=	var.id_Tab3ListVarStruct;
	event					=	var.event;
	meetdate				=	var.meetdate;
	remark					=	var.remark;
	backupnbackup			=	var.backupnbackup;
	id_SinglePageData		=	var.id_SinglePageData;
}

Tab3ListVarStruct::Tab3ListVarStruct()
{
	Initialize();
}

//******Tab4VarStruct
void
Tab4ListVarStruct::Initialize()
{
	id_SinglePageData=0;
	id_Tab4ListVarStruct = 0;
	classify=_T(" ");
	message=_T(" ");
}

bool
Tab4ListVarStruct::operator!=(const Tab4ListVarStruct& var)
{
	return	id_Tab4ListVarStruct	!=	var.id_Tab4ListVarStruct	||
			classify				!=	var.classify				||
			message					!=	var.message					||
			id_SinglePageData		!=	var.id_SinglePageData;
}

Tab4ListVarStruct&
Tab4ListVarStruct::operator = (const Tab4ListVarStruct& var)
{
	if(this!=&var){
		id_SinglePageData		=	var.id_SinglePageData;
		id_Tab4ListVarStruct	=	var.id_Tab4ListVarStruct;
		classify				=	var.classify;
		message					=	var.message;
	}

	return *this;
}

Tab4ListVarStruct::Tab4ListVarStruct(const Tab4ListVarStruct& var)
{
	id_SinglePageData		=	var.id_SinglePageData;
	id_Tab4ListVarStruct	=	var.id_Tab4ListVarStruct;
	classify				=	var.classify;
	message					=	var.message;
}

Tab4ListVarStruct::Tab4ListVarStruct()
{
	Initialize();
}

//******SinglePageData
void
SinglePageData::Initialize()
{
	//id_SinglePageData=0;
	//tab1Data.Initialize();
	//tab2Data.Initialize();
	//Tab3ListVarStruct tab3Data;
	//tab3DataList.AddTail(tab3Data);
	//Tab4ListVarStruct tab4Data;
	//tab4DataList.AddTail(tab4Data);
	listOrder=0;
}

SinglePageData&
SinglePageData::operator = (const SinglePageData& var)
{
	if(this!=&var){
		//id_SinglePageData	=	var.id_SinglePageData;
		tab1Data			=	var.tab1Data;
		tab2Data			=	var.tab2Data;
		POSITION posTab3 = var.tab3DataList.GetHeadPosition();
		while(posTab3){
			Tab3ListVarStruct data = var.tab3DataList.GetNext(posTab3);
			tab3DataList.AddTail(data);
		}
		POSITION posTab4 = var.tab4DataList.GetHeadPosition();
		while(posTab4){
			Tab4ListVarStruct data = var.tab4DataList.GetNext(posTab4);
			tab4DataList.AddTail(data);
		}
		listOrder			=	var.listOrder;
	}

	return *this;
}

SinglePageData::SinglePageData(const SinglePageData& var)
{
	//id_SinglePageData = var.id_SinglePageData;
	tab1Data = var.tab1Data;
	tab2Data = var.tab2Data;
	POSITION posTab3 = var.tab3DataList.GetHeadPosition();
	while(posTab3){
		Tab3ListVarStruct data = var.tab3DataList.GetNext(posTab3);
		tab3DataList.AddTail(data);
	}
	POSITION posTab4 = var.tab4DataList.GetHeadPosition();
	while(posTab4){
		Tab4ListVarStruct data = var.tab4DataList.GetNext(posTab4);
		tab4DataList.AddTail(data);
	}
	listOrder =var.listOrder;
}

SinglePageData::SinglePageData()
{
	Initialize();
}
